package com.smart.thrift.annotation;


import com.smart.thrift.config.server.ThriftServerAutoConfiguration;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
@ThriftComponentScan
@Import(ThriftServerAutoConfiguration.class)
public @interface ThriftServer {

    @AliasFor(annotation = ThriftServer.class, attribute = "serverId")
    String value() default "";

    // Thrift服务id,缺省取配置文件配置，配置文件缺省则随机
    @AliasFor(annotation = ThriftServer.class, attribute = "value")
    String serverId() default "";

    @AliasFor(annotation = ThriftComponentScan.class, attribute = "basePackages")
    String[] scanBasePackages() default {};

    @AliasFor(annotation = ThriftComponentScan.class, attribute = "basePackageClasses")
    Class<?>[] scanBasePackageClasses() default {};
}
